package com.example.lin.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author Administrator
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class R {

    private Integer code;

    private String msg;

    private Object data;

    public static R ok(Object data) {
        return new R(200, "success", data);
    }

    public static R error(String msg) {
        return new R(400, msg, null);
    }
}
